// 获取 title 和 content 的 DOM 节点
let titleDoms = document.querySelectorAll('.tabs-title');
let contentDoms = document.querySelectorAll('.tabs-content');

// 循环遍历
titleDoms.forEach(function (item, index) {
    item.addEventListener('click', function () {
        // 移除所有 title 和 content 的 active 和 show 类
        titleDoms.forEach(function (title) {
            title.classList.remove('active');
        });
        contentDoms.forEach(function (content) {
            content.classList.remove('show');
        });

        // 当前点击的 title 和对应 content 添加 active 和 show 类
        item.classList.add('active');
        contentDoms[index].classList.add('show');
    });
});

//登录跳转首页
let loginBtn = document.querySelector('.submit');

loginBtn.addEventListener('click',function(){
    window.location.href = '/home.html';
})

let regBtn = document.querySelector('.msg3');

regBtn.addEventListener('click',function(){
    window.location.href = '/register.html';
})

// 页面跳转
let navRegist = document.querySelector('.nav-regist');

navRegist.addEventListener('click',function(){
  window.location.href = '/register.html';
});

